package com.chinasofti.thread05;

public class MyThread1  extends  Thread{
    @Override
    public void run() {
        for (int i = 0; i <10 ; i++) {
            System.out.println(getName()+"====="+i);
        }
    }
}
class MyThread2  extends  Thread{
    @Override
    public void run() {
        for (int i = 0; i <100 ; i++) {
            System.out.println(getName()+"====="+i);
        }
    }
}
class Demo{
    public static void main(String[] args) {
        MyThread1 t1 = new MyThread1();
        MyThread2 t2 = new MyThread2();
        t1.setName("女神");//1-10
        t2.setName("舔狗");//1-100
        //把第二个线程设置为守护线程
        //当普通线程执行完毕后，守护线程就没有必要运行了
        t2.setDaemon(true);

        t1.start();
        t2.start();
    }
}